home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / powerb5.zip / P5UTL010.TIP < prev    next >
Text File  |  1993-06-01  |  2KB  |  50 lines

  1. Keeping a lot of directories in the search path set by your
  2. AUTOEXEC.BAT's PATH command is convenient, but it slows your
  3. machine and eats up a sizable chunk of your environment. I
  4. therefore developed a small batch file that lets you add and
  5. remove directories from your PATH on the fly.
  6.  
  7. NEWPATH.BAT checks each directory on your search path. If a
  8. listed directory doesn't exist, or if it's empty, NEWPATH
  9. removes it. Otherwise, the batch file asks you whether you
  10. want the directory there. Also, if you pass any directory
  11. names to NEWPATH as parameters, the batch file will ask you
  12. if those are to be included as well. NEWPATH affects only
  13. the search path in memory; your AUTOEXEC.BAT file's PATH
  14. command remains unchanged.
  15.  
  16. Divya Mahajan
  17. New Delhi, India
  18.  
  19. Editor's Note: NEWPATH.BAT is truly useful if you want to
  20. quickly exclude a few directories from your search path (or
  21. add a few others). It requires two support files: another
  22. batch, NEWPATH1.BAT, and a short program called YN.COM.
  23.  
  24. YN.COM performs a very simple task: It asks a yes/no
  25. question, waits for a 'Y' or an 'N', and returns an
  26. errorlevel of 1 for yes and 0 for no. YN.COM, along with
  27. NEWPATH.BAT and NEWPATH1.BAT, are included in the P5UTL
  28. directory of your PowerBase *.* Volume 5 diskette.
  29.  
  30. NEWPATH1.BAT shows how to use the IF EXIST batch command
  31. with wild cards. Because IF EXIST succeeds if any files
  32. match the pattern shown, and all files match *.*, the test
  33. will fail only if the directory is empty or doesn't exist
  34. (either way, it's useless in a search path). To test only
  35. for the existence of a directory, use IF EXIST with a
  36. standard device name such as PRN (which, by DOS convention,
  37. appears in any directory that exists). NEWPATH has one
  38. drawback: The starting size of your PATH command plus the
  39. combined length of your command-line parameters must not
  40. exceed 92 characters. If it does, you'll be left with no
  41. search path in memory at all.
  42.  
  43.  
  44. Title: Modify Your PATH on the Fly
  45. Category: UTL
  46. Issue Date: November, 1992
  47. Editor: Brett Glass
  48. Supplementary Files: P5UTL\NEWPATH.BAT, P5UTL\NEWPATH1.BAT, P5UTL\YN.COM
  49. Filename: P5UTL010.TIP
  50.